package com.sky.controller.admin;

import com.sky.result.Result;
import com.sky.service.WorkSpaceService;
import com.sky.vo.BusinessDataVO;
import com.sky.vo.OrderOverViewVO;
import com.sky.vo.SetmealOverViewVO;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 工作台控制器
 *
 * @author normal
 * @date 2025年03月06日 下午6:05
 */
@RestController
@Slf4j
@RequestMapping("/admin/workspace")
@RequiredArgsConstructor
public class WorkSpaceController {

    private final WorkSpaceService workSpaceService;

    /**
     * 获取今日运营数据
     *
     * @return {@link Result}<{@link BusinessDataVO}>
     */
    @GetMapping("/businessData")
    public Result<BusinessDataVO> getBusinessData() {
        log.info("获取今日运营数据");

        return Result.success(workSpaceService.getBusinessData());
    }

    @GetMapping("/overviewSetmeals")
    public Result<SetmealOverViewVO> getOverviewSetmeals() {
        log.info("获取套餐总览");
        return Result.success(workSpaceService.getOverviewSetmeals());
    }

    /**
     * 获取菜品 起售状态数量 总览
     *
     * @return
     */
    @GetMapping("/overviewDishes")
    public Result<SetmealOverViewVO> getOverviewDishes() {
        log.info("获取菜单总览");
        return Result.success(workSpaceService.getOverviewDishes());
    }

    /**
     *  查询订单管理数据
     */
    @GetMapping("/overviewOrders")
    public Result<OrderOverViewVO> getOverviewOrders() {
        log.info("查询订单管理数据");
        return Result.success(workSpaceService.getOverviewOrders());
    }




}
